const textelectment = document.getElementById('text')
const speedelectment = document.getElementById('speed')
const text = 'Happy Peach Blossom Festival!'
let index = 1
let speed = 300 / speedelectment.value
running()
function running() {
    textelectment.innerText = text.slice(0, index)
    index++
    if (index > text.length) {
        index = 1
    }
    setTimeout(running, speed)
}
speedelectment.addEventListener('input', (event) => speed = 300 / event.target.value)